package com.dkha.common.enums;

/**
 * @author Spring
 * @date 2019/11/22
 * @Description: 产业类型枚举
 */
public enum IndustryTypeEnum {

    FIRST_INDUSTRY("1", "一产"),
    SECOND_INDUSTRY("2", "二产"),
    THIRD_INDUSTRY("3", "三产");

    public String code;
    public String name;

    IndustryTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static IndustryTypeEnum getByCode(String code) {
        for(IndustryTypeEnum industryType : IndustryTypeEnum.values()){
            if(code.equals(industryType.code)){
                return industryType;
            }
        }
        return  null;
    }
}
